
//TODO a(28)
function a28(module, exports, a) {
    function i() {
    }

    var s = a(23), r = a(3), n = a(4), o = a(29), l = a(21), d = a(5), h = a(2);
    r.extend(i, s);
    var c = {
        init: function () {
            this.playerData = this.manager.playerData, this.isFirstVideo = !0, this.HEART_TIME = 120, this.HEART_TIMER = 5, this.HEART_REPORT_COUNT = parseInt(this.HEART_TIME / this.HEART_TIMER), this.heartAutoTime = null, this.heartCount = 0;
            var e = this.playerData.flashVar;
            this.isLive = "live" == this.playerData.playerType || "ov-live" == this.playerData.playerType, this.param = {
                ver: "3.7.2",
                p1: this.playerData.config.p1,
                p2: this.playerData.config.p2,
                p3: this.playerData.config.p3,
                lc: o.getLC(),
                weid: o.getWeid(),
                os: h.mac ? "os" : h.Android ? "android" : h.iPhone || h.iPad || h.iPod ? "ios" : h.wph ? "wince" : /symbian/i.test(navigator.userAgent) ? "symbian" : "-",
                br: this.getBrowser(),
                ro: screen.width + "_" + screen.height,
                ref: this.playerData.urlParams.ref || r.getCookie("tj_ref") || (document.referrer ? encodeURIComponent(document.referrer) : this.playerData.vinfo.fcode || "-"),
                pv: this.playerData.playerVersion,
                ch: "-",
                ty: e.ty || (this.isLive ? this.playerData.vinfo.channelId ? "2" : "1" : "0"),
                xh: h.letvTv ? "tv" : h.iPad || h.AndroidPad ? "pad" : "phone",
                url: encodeURIComponent(location.href),
                lid: this.playerData.vinfo.pid,
                uid: "-",
                ilu: 1,
                uuid: "-"
            }, this.errMap = {
                600: "0050",
                601: "0051",
                603: "0052",
                604: "0053",
                605: "0054",
                606: "0055",
                611: "0056",
                612: "0057",
                621: "1900",
                622: "1901",
                623: "0058",
                624: "1902",
                640: "0409",
                641: "0410",
                643: "0008",
                646: "0410",
                647: "0015",
                650: "0012",
                651: "0208",
                700: "1430",
                701: "1431",
                702: "1432",
                703: "1433",
                704: "1434",
                705: "1435",
                723: "1406",
                724: "1903",
                725: "1904",
                749: "1436",
                751: "0208"
            }, 1 == this.playerData.flashVar.isHttps && (l.HOST_NAME.APPLE_US_WWW_LETV_COM = "https://apple-us-www.le.com", l.HOST_NAME.APPLE_WWW_LETV_COM_HK = "https://apple-hk-www.le.com", l.HOST_NAME.APPLE_WWW_LETV_COM = "https://apple-www.le.com", l.HOST_NAME.V_STAT_LETV_COM = "https://vstat-api.letv.com", l.HOST_NAME.STAT_PC_LETV_COM = "https://stat-pc.letv.com"), this.manager.listener.on(l.REGION, function (e, t) {
                var a;
                switch (t) {
                    case"us":
                        a = l.HOST_NAME.APPLE_US_WWW_LETV_COM;
                        break;
                    case"hk":
                        a = l.HOST_NAME.APPLE_WWW_LETV_COM_HK;
                        break;
                    case"cn":
                    default:
                        a = l.HOST_NAME.APPLE_WWW_LETV_COM
                }
                this.urlList = {
                    EnvUrl: a + "/env/",
                    ActionUrl: a + "/pl/",
                    CNTVUrl: a + "/w/",
                    ErrorUrl: l.HOST_NAME.V_STAT_LETV_COM + "/vplay/flverr",
                    ErrorUrl2: a + "/er/",
                    ComScore: l.HOST_NAME.B_SCORECARDRESEARCH_COM + "/b",
                    statUrl: l.HOST_NAME.STAT_PC_LETV_COM + "/op"
                }
            }, this), this.manager.listener.on(l.USER_INFO, function (e, t) {
                this.param.uid = t ? t.ssouid : "-", this.param.ilu = t ? "0" : "1"
            }, this), this.manager.listener.on(l.PLAY_STATE, function (e, t) {
                if ("init" == t) {
                    this.param.uuid = o.getUUID();
                    var a = this.playerData.flashVar;
                    this.isFirstVideo ? this.isFirstVideo = !1 : delete a.chOnce, this.param.ch = encodeURIComponent(a.chOnce || a.tg || a.ch || a.typeFrom || ("live" == this.playerData.playerType ? "letv_live" : "letv"))
                } else if ("changeDefi" == t || "changeView" == t) {
                    var i = this.param.uuid.match(/_(\d+)/);
                    null == i ? this.param.uuid += "_1" : this.param.uuid = this.param.uuid.replace(i[0], "_" + (Number(i[1]) + 1))
                } else"changeReplay" == t && (this.param.uuid = o.getUUID())
            }, this)
        }, getUUID: function () {
            return this.param.uuid
        }, getLC: function () {
            return this.param.lc
        }, getCH: function () {
            return this.param.ch
        }, getBrowser: function () {
            for (var e, t, a = navigator.userAgent, i = [["qq", "(tencenttraveler)\\s([0-9].[0-9])"], ["ff", "(firefox)\\/([0-9])"], ["ff", "(minefield)\\/([0-9])"], ["ff", "(shiretoko)\\/([0-9])"], ["opera", "(opera)\\/([0-9])"], ["ie", "(msie)\\s([0-9].[0-9])"], ["chrome", "(chrome)\\/([0-9])"], ["qq", "(QQBrowser)\\/([0-9])"], ["UC", "(UCBrowser)\\/([0-9])"], ["safa", "(safari)\\/([0-9])"]], s = 0; s < i.length; s++)if (e = new RegExp(i[s][1], "i"), e.test(a)) {
                if (t = i[s][0], "ie" == t) {
                    var r = a.match(/(msie) ([\w]+)/i);
                    null != r && (t += r[2])
                }
                break
            }
            return t || "other"
        }, isLogin: function () {
            var e = this.manager.listener.get(l.USER_INFO);
            return e ? "0" : "1"
        }, getRadom: function () {
            for (var e = "", t = 0; t < 12; t++)e += Math.floor(10 * Math.random());
            return e
        }, sendComStore: function () {
            if (1 != this.playerData.flashVar.isHttps) {
                var e = this.playerData.vinfo, t = {c1: 1, c2: "8640631", c3: e.vid, c4: "", c5: e.pid, c6: e.cid};
                r.sendRequest(this.urlList.ComScore, t)
            }
        }, sendProxyError: function (e, t) {
            this.manager.log.pushLog("sendProxyError: " + e), 4 == String(e).length && (e = "9" + e);
            var a = {t: "error", s: this.manager.listener.get(l.REGION), u: encodeURIComponent(t) || "H5", v: e};
            r.sendRequest(this.urlList.statUrl, a)
        }, sendError: function (e) {
            this.manager.log.pushLog("errCode: " + e), this.sendProxyError(e);
            var t = this.playerData.vinfo, a = {
                errno: e,
                url: this.param.url,
                vid: t.vid,
                mid: "",
                ch: this.param.ch,
                ver: this.playerData.playerVersion,
                _r: Math.random()
            };
            r.sendRequest(this.urlList.ErrorUrl, a);
            var i;
            if (i = this.errMap[e]) {
                var a = {
                    ver: this.param.ver,
                    p1: this.param.p1,
                    p2: this.param.p2,
                    p3: this.param.p3,
                    et: "pl",
                    err: i,
                    lc: this.param.lc,
                    r: this.getRadom(),
                    os: this.param.os,
                    br: this.param.br,
                    cid: t.cid || "",
                    vid: t.vid || "",
                    pid: t.pid || "",
                    zid: t.zid || "",
                    uuid: this.param.uuid,
                    app_name: "H5Player",
                    nt: "none"
                };
                r.sendRequest(this.urlList.ErrorUrl2, a)
            }
        }, sendEnv: function () {
            var e = {
                p1: this.param.p1,
                p2: this.param.p2,
                p3: this.param.p3,
                lc: this.param.lc,
                uuid: this.param.uuid,
                mac: "-",
                nt: "none",
                os: this.param.os,
                src: "pl",
                xh: this.param.xh,
                br: this.param.br,
                ro: this.param.ro,
                r: this.getRadom(),
                app_name: "H5Player",
                ssid: "-",
                app: "-",
                ctime: (new Date).getTime(),
                ver: this.param.ver
            };
            r.sendRequest(this.urlList.EnvUrl, e)
        }, sendPlayAction: function (e, t, a) {
            var i = this.playerData.vinfo, s = r.now(), o = this.getRadom();
            param = {
                ac: e,
                py: encodeURIComponent("cl=" + n.getCl(this.param.lc) + "&br=" + navigator.userAgent),
                ver: this.param.ver,
                p1: this.param.p1,
                p2: this.param.p2,
                p3: this.param.p3,
                ty: this.param.ty,
                uid: this.param.uid,
                lc: this.param.lc,
                uuid: this.param.uuid,
                cid: i.cid || "",
                pid: this.isLive ? "" : i.pid || "",
                vid: i.vid || "",
                lid: this.isLive ? i.pid || "" : "",
                st: this.isLive ? i.channelEname || "" : "",
                sid: i.curSid || "",
                vlen: i.gdur || "",
                ch: this.param.ch,
                url: this.param.url,
                weid: this.param.weid,
                ref: this.param.ref,
                pv: this.param.pv,
                ilu: this.param.ilu,
                ctime: s,
                r: o,
                key: n.getPingBackKey(this.param.lc.toLowerCase(), this.param.uuid.toLowerCase(), s, o),
                app_name: "H5Player",
                nt: "none",
                ipt: this.playerData.vinfo.up ? 1 : 0
            };
            var l = {pt: "-", ut: "-", ry: "0", vt: this.playerData.vinfo.curVtype || ""};
            r.merge(l, t), r.merge(param, l), i.zid && (param.zid = i.zid), this.param.lid && (param.lid = this.param.lid), i.owner && (param.owner = 1 == parseInt(i.owner) ? 1 : 0), i.urlMid && (param.mid = i.urlMid), i.urlSource && (param.source = i.urlSource), r.sendRequest(this.urlList.ActionUrl, param)
        }, sendDuration: function (e, t) {
            e = (e / 1e3).toFixed(1), e = String(e).split(".")[1] > 5 ? Math.ceil(e) : Math.floor(e) + .5;
            var a = {t: "duration", s: t, v: e, k: d.MD5("pc_stat_api" + e)};
            r.sendRequest(this.urlList.statUrl, a)
        }, startHeartRecord: function () {
            clearInterval(this.heartAutoTime), this.heartCount = 0, this.heartAutoTime = setInterval(r.bind(function () {
                ++this.heartCount == this.HEART_REPORT_COUNT && this.flushHeartRecord()
            }, this), 1e3 * this.HEART_TIMER)
        }, stopHeartRecord: function () {
            clearInterval(this.heartAutoTime), this.flushHeartRecord()
        }, flushHeartRecord: function () {
            this.heartCount && (this.sendPlayAction("time", {pt: 5 * this.heartCount}), this.heartCount = 0)
        }
    };
    r.merge(i.prototype, c), module.exports = i
}
